﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Forum.Master" AutoEventWireup="true" CodeBehind="edit.aspx.cs" Inherits="Client.WebForm2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <meta charset="utf-8" />
<script type="text/javascript" src="Scripts/json2.js"></script>
<script type="text/javascript" src="Scripts/json_parse.js"></script>
<script type="text/javascript" src="Scripts/json_parse_state.js"></script>
<script type="text/javascript" src="Scripts/cycle.js"></script>
<script type="text/javascript" src="Scripts/1.js"></script> 

<script src="Scripts/jquery-1.8.2.js"></script>
    <script src="Scripts/jquery-ui-1.9.1.custom.js"></script>
    <link rel="stylesheet" href="Styles/jquery-ui-1.9.1.custom.css" />
    <link rel="stylesheet" href="Styles/jquery-ui.css" />
     
    <style>
    
        #Text2
        {
            width: 231px;
        }
        #Text1
        {
            width: 231px;
        }
        #Text3
        {
            width: 231px;
        }
        #Password1
        {
            width: 194px;
        }
        #Password2
        {
            width: 194px;
        }
        #Password3
        {
            width: 194px;
        }
        #Pass1
        {
            width: 241px;
        }
        #Pass2
        {
            width: 241px;
        }
        #Pass3
        {
            width: 241px;
        }
    </style>

    <script>
       $(function() {
    $( "#tabs11" ).tabs({
      event: "mouseover"
    });
  });
       
        function ChangeA()
        {
            var url=$('#ChangeAv').val();
            jQuery.support.cors = true;
            $.ajax({
                    url: 'http://localhost:18796/api/values/?name='+<%=ReturnName() %>+'&url='+url,
                    type: 'GET',
                    dataType: 'json',
                    success: function (data) {
                        if(data==true)
                        {
                             alert('Successful ... !');
                              window.location.reload();
                        }
                        else
                        {
                            alert('Failes, Current password maybe incorect ... !');
                        }
                    },
                    error: function () {
                        alert('Please Try Again !');
                    }
                });
        }
        function changePass() {
        jQuery.support.cors = true;
            if ($('#Pass2').val() == $('#Pass3').val())
             {
                $.ajax({
                    url: 'http://localhost:18796/api/values/?pass='+$('#Pass1').val()+'&name='+<%=ReturnName() %>+'&newpass='+$('#Pass2').val(),
                    type: 'GET',
                    dataType: 'json',
                    success: function (data) {
                        if(data==true)
                        {
                             alert('Successful ... !');
                        }
                        else
                        {
                            alert('Failes, Current password maybe incorect ... !');
                        }
                    },
                    error: function () {
                        alert('Please Try Again !');
                    }
                });
            }
            else {
                alert('Confirm Pass and Pass is different !');
            }
            
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

 <div style="">
        
    <div style=" float:inherit;height:375px">
        

        <div id="tabs11" style="float:inherit">
            <div style="float:inherit; height: auto; width: 100%; background-color: #FFFFFF;">
            <div align="center" style="float:inherit;height: 50px;width: 100%; background-color: #444444; ">
                
                <br />
                
                <asp:Label ID="Label16" runat="server" Font-Bold="True" Font-Size="XX-Large" 
                    ForeColor="White" Text="Quản lý Tài Khoản"></asp:Label>
            </div>
        </div>
        <ul>
            <li><a href="#tabs-1">Thông Tin Người Dùng</a></li>
            <li><a href="#tabs-2">Đổi Password</a></li>
            <li><a href="#tabs-3">Đổi Avatar</a></li>
        </ul>
        <div id="tabs-1" style="width: 100%">
            <asp:Image ID="Image1" runat="server" />
            <br />
            <asp:Label ID="Label1" runat="server" Text="Tên Tài khoản : "></asp:Label>
            
            <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
            
        </div>
        <div id="tabs-2"  style="width: 100%">
            
            <table style="width:100%;">
                <tr>
                    <td align="right" width="35%">
                        Password hiện tai :</td>
                    <td width="65%">
                        <input id="Pass1" type="password" maxlength="15"/></td>
                </tr>
                <tr>
                    <td align="right" width="35%">
                        Password mới :</td>
                    <td width="65%">
                        <input id="Pass2" type="password" maxlength="15"/></td>
                </tr>
                <tr>
                    <td align="right" width="35%">
                        Nhập Lại Password :</td>
                    <td width="65%">
                        <input id="Pass3" type="password" maxlength="15"/></td>
                </tr>
                <tr>
                    <td colspan="2" align="right">
                         <input id="Button11" type="button" value="Change Password" onclick="changePass()"/></td>
                </tr>
            </table>
            
        </div>
        <div id="tabs-3"  style="width: 100%">          
            <input type="text" id="ChangeAv" value="input url image" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="button" value="Change Avatar" onclick="ChangeA()"/>
            
        </div>
    </div>
        </div>
     </div>
</asp:Content>
